import { ISchema } from '@formily/react'

export const FormStep: ISchema & { StepPane?: ISchema } = {
  type: 'object',
  properties: {
    defaultCurrent: {
      type: 'number',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
      'x-component-props': {
        defaultValue: 0,
      },
    },
    backText: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
      'x-component-props': {
        defaultValue: '上一步',
      },
    },
    nextText: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
      'x-component-props': {
        defaultValue: '下一步',
      },
    },
    submitText: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
      'x-component-props': {
        defaultValue: '提交',
      },
    },
    resultTitle: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
      'x-component-props': {
        defaultValue: '已完成',
      },
    },
    submitExpression: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'ExpressionDialogSetter',
    },
  },
}

FormStep.StepPane = {
  type: 'object',
  properties: {
    title: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
    },
    subTitle: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
    },
    description: {
      type: 'string',
      'x-decorator': 'FormItem',
      'x-component': 'Input',
    },
    disabled: {
      type: 'boolean',
      'x-decorator': 'FormItem',
      'x-component': 'Switch',
    },
  },
}
